package netmon.snmp;

import java.util.HashMap;
import java.util.Map;

/**
 * Class which converts the Object names into OIDs
 * @author Marc Backes
 */
public class OIDConverter {
	private Map<String, String> oidMap;
	
	/**
	 * Constructor: Generates the map of needed OIDs
	 */
	public OIDConverter(){
		oidMap = new HashMap<String, String>();
		oidMap.put("sysDescr", ".1.3.6.1.2.1.1.1.0");
		oidMap.put("hrSystemUptime", ".1.3.6.1.2.1.25.1.1.0");
		oidMap.put("sysContact", ".1.3.6.1.2.1.1.4.0");
		oidMap.put("sysLocation", ".1.3.6.1.2.1.1.6.0");
		oidMap.put("sysName", ".1.3.6.1.2.1.1.5.0");
		oidMap.put("tcpActiveOpens", ".1.3.6.1.2.1.6.5.0");
		oidMap.put("hrSystemProcesses", ".1.3.6.1.2.1.25.1.6.0");
		oidMap.put("ifInOctets", ".1.3.6.1.2.1.2.2.1.10");		// ATTENTION! Need to append ".<interface>"!!
		oidMap.put("ifOutOctets", ".1.3.6.1.2.1.2.2.1.16");		// ATTENTION! Need to append ".<interface>"!!
		oidMap.put("ifPhysAddress", ".1.3.6.1.2.1.2.2.1.6");	// ATTENTION! Need to append ".<interface>"!!
	}
	
	/**
	 * Get the OID from the given object name<br>
	 * <b><i>Only, if it is a registered object!</i></b>
	 * @return OID - Object ID of the requested name
	 */
	public String get(String name){
		return oidMap.get(name);
	}
}
